<template>
	<div id="activity_detail">
		<div id="app">
			<div class="cover">
				<img :src="'https://yo.docshare.org.cn'+active.contentphoto" style="width: 100%;">
			</div>
			<div class="title">
				<label>{{active.name}}：一场灵魂与身体的旅行</label>
				<div class="sprice">
					报名费：<font>￥{{active.cost}}</font>起/人
				</div>
				<div class="clear"></div>
			</div>
			<div class="time">
				<div class="date">
					<img src="https://yo.docshare.org.cn/static/images/time.png">
					<p>出发时间：{{active.time}}</p>
					<div class="clear"></div>
				</div>
				<ul>
					<li class="phone">
						<p>活动咨询：<span>{{active.activetel}}</span></p>
					</li>
					<li class="phone">
						<p>集合地点：<span>{{active.address}}</span></p>
					</li>
				</ul>
			</div>

			<div class="all_comment">
				<div class="item">
					<span>点评</span>
				</div>
				<div id="all_comment">
					<ul>
						<li v-for="a in active1.slice(0,3)">
						
							<div class="comment_list">
								<div class="message">
									<img :src="'https://yo.docshare.org.cn'+a.photo">
									<label class="name">{{a.user_name}}</label>
									<span class="date">{{a.time}}</span>
									<div class="clear"></div>
								</div>
								<p>
									{{a.comment}}
								</p>
							</div>
						
						</li>
					</ul>
				</div>
				<div class="more">
					<a @click="itemClicked(active)">查看全部评价</a>
				</div>
			</div>

			<div id="buy_nav">
				<a class="call" href="#" @click="uni.makePhoneCall({
					phoneNumber:active.activetel
				})"> <img src="https://yo.docshare.org.cn/static/images/call.png" />
					<p>电话咨询</p>
				</a>
				<div align="left">
					<input class="cur" type="button" @click="itemClicked1(active)" value="立即报名"></input>
				</div>
				<div id="more" align="right">
					<input class="cur" type="button" @click="itemClicked2(active)" value="写评价"></input>
				</div>
			</div>

		</div>
	</div>
</template>

<script>
	import config from '@/config'
	export default {
		data() {
			return {
				uni,
				usr: '',
				active: {},
				active1:[],
				vid:'',
			}
		},
		onLoad(option){
			if(option.id){
				this.vid = option.id;
			}
			var that = this;
			uni.request({
				url: `${config.baseUrl}/active/one?token=` + uni.getStorageSync('token') + '&id=' + that.vid,
				method: 'GET',
				success(r) {
					if (r.data.succ) {
							that.active = r.data.data;
					} else {
					
					}
				},
					complete(res){
						if(res.data && res.data.msg){
							uni.showToast({
								icon:'none',
								title:res.data.msg
							})
						}
					},
			});
			uni.request({
				url: `${config.baseUrl}/comment/list?token=` + uni.getStorageSync('token') + '&id=' + that.vid,
				method: 'GET',
				success(r) {
					if (r.data.succ) {
						that.active1 = r.data.data;
					} else {
			
					}
				},
					complete(res){
						if(res.data && res.data.msg){
							uni.showToast({
								icon:'none',
								title:res.data.msg
							})
						}
					},
			});
		},
		methods: {
			itemClicked:function(item){
				uni.navigateTo({
					url:'project_comment?id='+item.id
				})
			},
			itemClicked1:function(item){
				uni.navigateTo({
					url:'join?id='+item.id
				})
			},
			itemClicked2:function(item){
				uni.navigateTo({
					url:'write_comment?id='+item.id
				})
			}
	
		}
	}
</script>

<style>
</style>
